<ul id="ad_ul">
<?php
	if(empty($items)){
		echo CHtml::tag('li', array('class'=>'no_record'), null, false);
		echo CHtml::image(CommonHelper::get_thumb(NO_PICTURE, '80x80'));
		echo '暂无记录！';
		echo CHtml::closeTag('li');
	}else{
		foreach ($items as $item){
			if(!isset($item['picture'])){
				$item['picture'] = NO_PICTURE;
			}
?>
	<li class="item"> 
		<div class="img_content">
			<div class="img"> 
				<?php 
					echo CHtml::image(CommonHelper::get_thumb($item['picture'], $thumb));
					echo YHtml::activeHiddenField($item, 'picture', array('id'=>false, 'name'=>'pictures[]'));
				?>
			</div> 
			<div class="uploader"></div>
		</div>
		<div class="item_info">
			<div class="row"> 
				<strong>广告标题：</strong>  
				<?php echo YHtml::activeTextField($item, 'title', array('name'=>'titles[]', 'class'=>'ad_item_title', 'id'=>false, 'rule'=>'^.+$'))?>
			</div>
			<div class="row"> 
				<strong>广告链接：</strong>  
				<?php echo YHtml::activeTextField($item, 'url', array('name'=>'urls[]', 'id'=>false))?>
				<p>点击广告后打开的网址</p>
			</div>
			<div class="row"> 
				<strong>打开位置：</strong>
				<?php echo YHtml::activeDropDownList($item, 'target', array('_blank'=>'新窗口', '_top'=>'当前窗口'), array('id'=>false, 'name'=>'targets[]'))?>
				<p>打开网址的位置</p>
			</div>
			<div class="row"> 
				<strong>有效期：</strong> 
				<?php echo YHtml::activeTextField($item, 'start', array('name'=>'starts[]', 'class'=>'date', 'id'=>false, 'rule'=>'^$|^\d{4}\-\d{1,2}\-\d{1,2}$'))?> - 
				<?php echo YHtml::activeTextField($item, 'end', array('name'=>'ends[]', 'class'=>'date', 'id'=>false, 'rule'=>'^$|^\d{4}\-\d{1,2}\-\d{1,2}$'))?>
				<p>为空表示不作限制，超过时间后，将自动隐藏</p>
			</div>
			<div class="row"> 
				<strong>备注：</strong>  
				<?php echo YHtml::activeTextArea($item, 'desc', array('name'=>'descs[]', 'id'=>false))?>
			</div>
		</div> 
		<div class="options">
			<a href="javascript:void(0)" class="del_link">删除</a>
		</div>
	</li>
	<?php 
		}
	}
	?>
</ul>
<div id="queuer"></div>